package com.hfh.pattern;

/**
 * @Author hfh
 * @Date 2022 09 16 14 40
 **/
public class CoffeeStore2 {

    private CoffeeFactory factory;

    public CoffeeStore2(CoffeeFactory factory) {
        this.factory = factory;
    }

    public Coffee orderCoffee(String type) {
        Coffee coffee = factory.createCoffee();
        coffee.addMilke();
        coffee.addsugar();
        return coffee;
    }
}
